package cn.wolfcode.luowowo.search.domain;

import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Getter
@Setter
@ToString
public class FlightInfo {
    private Long id;

    private String orgCity;

    private String dstCity;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date depTime;

    private List<AirInfo> list;

    public String getJson(){
        Map<String, Object> map = new HashMap<>();
        map.put("id",id);
        map.put("orgCity",orgCity);
        map.put("dstCity",dstCity);
        map.put("depTime",depTime);
        return JSON.toJSONString(map);
    }
}